<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="霜序廿的个人网站">
  <link 
    rel="icon" 
    href="https://api2.mubu.com/v3/photo/654b368e-b847-4122-982c-86d90b3f5275.jpg">
  <title>小爱课程表~</title>
  
    
      <meta 
        property="og:title" 
        content="小爱课程表~">
    
    
      <meta 
        property="og:url" 
        content="https://shuangxunian.github.io/2021/06/13/MIAIsCurriculum/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://api2.mubu.com/v3/photo/654b368e-b847-4122-982c-86d90b3f5275.jpg">
    
    
      <meta 
        property="og:img" 
        content="MIUI12以上的小米自带课程表">
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2021-06-13">
      <meta 
        property="og:article:modified_time" 
        content="2020-09-27">
      <meta 
        property="og:article:author" 
        content="霜序廿">
      
        
          <meta 
            property="og:article:tag" 
            content="js">
        
      
    
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
      
      
      
      
        
        
        
        <script>
          function prismThemeChange() {
            if(document.getElementById('theme-color').dataset.mode === 'dark') {
              if(document.querySelector('[data-prism]')) {
                changeCSS('/js/lib/prism/prism-tomorrow.min.css', '[data-prism]', 'prism-tomorrow');
              } else {
                loadCSS('/js/lib/prism/prism-tomorrow.min.css', 'prism', 'prism-tomorrow');
              }
            } else {
              if(document.querySelector('[data-prism]')) {
                changeCSS('/js/lib/prism/prism.min.css', '[data-prism]', 'prism');
              } else {
                loadCSS('/js/lib/prism/prism.min.css', 'prism', 'prism');
              }
            }
          }
          prismThemeChange()
        </script>
      
      
        
        <link rel="stylesheet" href="/js/lib/prism/prism-line-numbers.min.css">
      
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
        prismThemeChange();
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
        prismThemeChange();
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
        prismThemeChange();
      }
    };
    setDarkmode();
    </script>
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
  
  <link rel="stylesheet" href="/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
    <link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">
  
<meta name="generator" content="Hexo 5.4.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
        <img 
          class="navbar-logo-img" 
          src="https://api2.mubu.com/v3/photo/654b368e-b847-4122-982c-86d90b3f5275.jpg" 
          alt="blog logo">
      
      <span class="navbar-logo-dsc">霜序廿的个人网站</span>
    </span>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
      <a 
        href="/links" 
        class="navbar-menu-item">
        
          友链
        
      </a>
    
    <a 
      class="navbar-menu-item darknavbar" 
      id="dark">
      <i class="iconfont icon-weather"></i>
    </a>
    <a 
      class="navbar-menu-item searchnavbar" 
      id="search">
      <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i>
    </a>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      小爱课程表~
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-06-13T13:48:56.191Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2021-06-13</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/" 
          class="post-meta-link">
          技术文章
        </a>
      
    
    
      <span class="dot"></span>
      <span>3.2k 字</span>
    
  </div>
  
    <div 
      class="post-meta post-show-meta" 
      style="margin-top: -10px;">
      <div style="display: flex; align-items: center;">
        <i 
          class="iconfont icon-biaoqian" 
          style="margin-right: 2px; font-size: 1.15rem;">
        </i>
        
          
          <a 
            href="/tags/js/" 
            class="post-meta-link">
            js
          </a>
        
      </div>
    </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>本文将从使用和实现两个方面来介绍小爱课程表~</p>
<p><strong>注意：</strong>你的手机系统必须在MIUI12及以上。</p>
<h2 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h2><ol>
<li>打开小爱语音助手（从下边搜索栏或者语音说小爱同学都能打开）。</li>
<li>说：打开课程表。</li>
<li>点最右边标签，选择学校，选择我编写的版本（OSSA王跃霖）。</li>
<li>找到教务网站导入（需要连接校园网），点进去。</li>
<li>输入账号密码，点击信息查询标签，再点击学生课表查询标签。</li>
<li>点击下方一键导入。</li>
<li>导入成功后，选择当前周数，改成对应周数。</li>
</ol>
<h2 id="实现"><a href="#实现" class="headerlink" title="实现"></a>实现</h2><ol>
<li>下载<a target="_blank" rel="noopener" href="https://cnbj1.fds.api.xiaomi.com/aife/AISchedule/AISchedule.zip">AISchdule DevTools</a>压缩包，解压到本地。</li>
<li>下载Chrome，打开链接 chrome://extensions/ ，打开开发者模式，导入AISchedule DevTools文件夹。</li>
<li>在Chrome打开一个新的Tab，打开、登陆自己的教务系统，进入课程页面。</li>
<li>在网页内右键，选「检查」，打开Chrome开发者工具，会有新增的AISchedule标签，进入后请跟随新手引导，创建「适配项目」。<strong>注意：</strong>学校url请填写官方url，不要填写ip或者代理！</li>
<li>当你点击provider/parser函数的代码区时，会跳转到sources中，在此你可以编辑scheduleHtmlProvider函数、scheduleHtmlParser函数，并打断点debug。</li>
<li>你可以参考注释与示例函数，编写两个适配函数。按ctrl+s/cmd+s保存，然后在网页中右键，选「AISchedule DevTools 运行」，Console中会打印出运行结果，两个函数的输出会分别在新窗口中显示，以便你边参考边修改函数。scheduleHtmlParser函数的输出须符合以下数据结构。<strong>注意：</strong>代码中无需引用任何模块，不要带有“require”这样的字符</li>
<li>经过调试，如果在console中看到「All run successfully」，然后你可以上传到手机端，进行E2E自测（端到端自测）。</li>
<li>在手机端打开课程表的教务导入功能，搜索学校，选择自己提交的适配，你可亲自体验，验证可用性。如果你觉得没问题，请点击反馈按钮「完美」，至此，你的适配已完成，状态为审核中。</li>
<li>工具中会保存你的历史适配记录和适配学校的状态，如果你的适配项目发布了，会为很多同学提供便利哦~</li>
</ol>
<p>以上来自<a target="_blank" rel="noopener" href="https://ldtu0m3md0.feishu.cn/docs/doccnhZPl8KnswEthRXUz8ivnhb#">小爱课程表 开发者工具 使用文档-本校模式</a>官方提供的文档，下边是关于代码的内容~</p>
<p>本文写于20年09月11日，此期间因为疫情原因，学校分年级上课，各个年级上课时间和休息时间都不一样，所以我就let了四个年级的上下课时间表，心算的各个年级上下课时间，可能存在时间错误的问题，如果你的年级存在问题请联系我。</p>
<p>从官方文档知道，我们只需要编辑两个文件：<br><strong>scheduleHtmlProvider.js</strong><br><strong>scheduleHtmlPasrse.js</strong><br>第一个文件适配得较好，用来截取HTML片段，而你截取的片段将弹出窗口以页面的形式展现，如果你发现弹出窗口中已经包含了课程表，就可以开始编辑第二个文件了。</p>
<p>第二个文件是关键，我们需要通过js拿到我们想要的数据，然后对数据进行操作，这里以方正举例：</p>
<pre class="line-numbers language-javascript" data-language="javascript"><code class="language-javascript"><span class="token keyword">function</span> <span class="token function">scheduleHtmlParser</span><span class="token punctuation">(</span><span class="token parameter">html</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
    <span class="token comment">//除函数名外都可编辑</span>
    <span class="token comment">//传入的参数为上一步函数获取到的html</span>
    <span class="token comment">//可使用正则匹配</span>
    <span class="token comment">//可使用解析dom匹配，工具内置了$，跟jquery使用方法一样，直接用就可以了，参考：https://juejin.im/post/5ea131f76fb9a03c8122d6b9</span>
    <span class="token comment">//以下为示例，您可以完全重写或在此基础上更改</span>

    <span class="token keyword">let</span> result <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
    <span class="token keyword">let</span> bbb <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'#table1 .timetable_con'</span><span class="token punctuation">)</span>
    <span class="token keyword">let</span> wyl_id <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'.timetable_title h6'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>data<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'：'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> u <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> u <span class="token operator">&lt;</span> bbb<span class="token punctuation">.</span>length<span class="token punctuation">;</span> u<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
        <span class="token keyword">let</span> re <span class="token operator">=</span> <span class="token punctuation">&#123;</span> sections<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span> weeks<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token punctuation">&#125;</span>
        <span class="token keyword">let</span> aaa <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>bbb<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">'span'</span><span class="token punctuation">)</span>
        <span class="token keyword">let</span> week <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>bbb<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">parent</span><span class="token punctuation">(</span><span class="token string">'td'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>id
        <span class="token keyword">if</span> <span class="token punctuation">(</span>week<span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
            re<span class="token punctuation">.</span>day <span class="token operator">=</span> week<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aaa<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'上课地点'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>position <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'节/周'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                    <span class="token keyword">let</span> lesson <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'('</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> a <span class="token operator">&lt;</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'('</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'节'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span> a<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                        re<span class="token punctuation">.</span>sections<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">&#123;</span> section<span class="token operator">:</span> a <span class="token punctuation">&#125;</span><span class="token punctuation">)</span>
                    <span class="token punctuation">&#125;</span>
                    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> a <span class="token operator">&lt;</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'周'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span> a<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                        re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
                    <span class="token punctuation">&#125;</span>
                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'教师'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>teacher <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>class <span class="token operator">==</span> <span class="token string">'title'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">children</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>name <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">children</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data

                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>

        <span class="token punctuation">&#125;</span>
        result<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>re<span class="token punctuation">)</span>
    <span class="token punctuation">&#125;</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span>

    <span class="token keyword">return</span> <span class="token punctuation">&#123;</span>courseInfos<span class="token operator">:</span> result<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p>从代码知道，这里的代码按jQuery的语法去写即可，正常情况下该代码可以正常读取到方正的课程表，只不过没有时间，我们需要的是添加一个时间，这里以我校举例，我校因为疫情原因分年级上课，各个年级上课时间和休息时间都不一样，所以我就let了四个年级的上下课时间表，然后通过js拿到了学号的text，对学号的1、2位进行判断可知该学生所在的年级，let一个列表用来存时间，然后将此二位数字当做判断条件进行赋值，再在最后的return中加入<strong>sectionTimes: wyl_sectionTime</strong>即可，代码如下：</p>
<pre class="line-numbers language-javascript" data-language="javascript"><code class="language-javascript"><span class="token keyword">function</span> <span class="token function">scheduleHtmlParser</span><span class="token punctuation">(</span><span class="token parameter">html</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
<span class="token keyword">function</span> <span class="token function">scheduleHtmlParser</span><span class="token punctuation">(</span><span class="token parameter">html</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
    <span class="token comment">//除函数名外都可编辑</span>
    <span class="token comment">//传入的参数为上一步函数获取到的html</span>
    <span class="token comment">//可使用正则匹配</span>
    <span class="token comment">//可使用解析dom匹配，工具内置了$，跟jquery使用方法一样，直接用就可以了，参考：https://juejin.im/post/5ea131f76fb9a03c8122d6b9</span>
    <span class="token comment">//以下为示例，您可以完全重写或在此基础上更改</span>
    <span class="token comment">// //大一</span>
    <span class="token comment">// const wyl_startTime1 = ["08:00", "08:50", "09:45", "10:35", "13:00", "13:50", "14:45", "15:35", "18:30", "19:20"]</span>
    <span class="token comment">// const wyl_endTime1 = ["08:45", "09:35", "10:30", "11:20", "13:45", "14:35", "15:30", "16:20", "19:15", "20:05"]</span>

    <span class="token comment">// //大二</span>
    <span class="token comment">// const wyl_startTime2 = ["08:10", "09:00", "10:00", "10:50", "13:10", "14:00", "15:00", "15:50", "18:30", "19:20"]</span>
    <span class="token comment">// const wyl_endTime2 = ["08:55", "09:45", "10:45", "11:35", "13:55", "14:45", "15:45", "16:35", "19:15", "20:05"]</span>

    <span class="token comment">// //大三</span>
    <span class="token comment">// const wyl_startTime3 = ["08:20", "09:10", "10:15", "11:05", "13:20", "14:10", "15:15", "16:05", "18:30", "19:20"]</span>
    <span class="token comment">// const wyl_endTime3 = ["09:05", "09:55", "11:00", "11:50", "14:05", "14:55", "16:00", "16:50", "19:15", "20:05"]</span>

    <span class="token comment">// //大四</span>
    <span class="token comment">// const wyl_startTime4 = ["08:30", "09:20", "10:30", "11:20", "13:30", "14:20", "15:30", "16:20", "18:30", "19:20"]</span>
    <span class="token comment">// const wyl_endTime4 = ["09:15", "10:05", "11:15", "12:05", "14:15", "15:05", "16:15", "17:05", "19:15", "20:05"]</span>

    <span class="token comment">//算的头疼，没觉得code能力变强，倒是觉得心算能力增强了</span>

    <span class="token keyword">const</span> wyl_startTime <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">"08:20"</span><span class="token punctuation">,</span> <span class="token string">"09:15"</span><span class="token punctuation">,</span> <span class="token string">"10:20"</span><span class="token punctuation">,</span> <span class="token string">"11:15"</span><span class="token punctuation">,</span> <span class="token string">"13:30"</span><span class="token punctuation">,</span> <span class="token string">"14:25"</span><span class="token punctuation">,</span> <span class="token string">"15:30"</span><span class="token punctuation">,</span> <span class="token string">"16:25"</span><span class="token punctuation">,</span> <span class="token string">"18:10"</span><span class="token punctuation">,</span> <span class="token string">"19:05"</span><span class="token punctuation">]</span>
    <span class="token keyword">const</span> wyl_endTime <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token string">"09:05"</span><span class="token punctuation">,</span> <span class="token string">"10:00"</span><span class="token punctuation">,</span> <span class="token string">"11:05"</span><span class="token punctuation">,</span> <span class="token string">"12:00"</span><span class="token punctuation">,</span> <span class="token string">"14:15"</span><span class="token punctuation">,</span> <span class="token string">"15:10"</span><span class="token punctuation">,</span> <span class="token string">"16:15"</span><span class="token punctuation">,</span> <span class="token string">"17:10"</span><span class="token punctuation">,</span> <span class="token string">"18:55"</span><span class="token punctuation">,</span> <span class="token string">"19:50"</span><span class="token punctuation">]</span>

    <span class="token keyword">let</span> result <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
    <span class="token keyword">let</span> bbb <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">'#table1 .timetable_con'</span><span class="token punctuation">)</span>

    <span class="token comment">//学号头两位，取消分年级上课以后这个就没用了- -</span>
    <span class="token comment">//let wyl_id = $('.timetable_title h6')[1].children[0].data.split('：')[1]</span>

    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> u <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> u <span class="token operator">&lt;</span> bbb<span class="token punctuation">.</span>length<span class="token punctuation">;</span> u<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
        <span class="token keyword">let</span> re <span class="token operator">=</span> <span class="token punctuation">&#123;</span> sections<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span> weeks<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token punctuation">&#125;</span>
        <span class="token keyword">let</span> aaa <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>bbb<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">'span'</span><span class="token punctuation">)</span>
        <span class="token keyword">let</span> week <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>bbb<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">parent</span><span class="token punctuation">(</span><span class="token string">'td'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>id

        <span class="token keyword">if</span> <span class="token punctuation">(</span>week<span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
            re<span class="token punctuation">.</span>day <span class="token operator">=</span> week<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> aaa<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'上课地点'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>position <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'节/周'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token comment">// for (let j = 0; j &lt; $(aaa[i]).next()[0].children.length; j++) &#123;</span>

                <span class="token comment">//     let lesson = $(aaa[i]).next()[0].children[j].data</span>

                <span class="token comment">//     for (let a = Number(lesson.split(')')[0].split('(')[1].split('-')[0]); a &lt; Number(lesson.split(')')[0].split('(')[1].split('-')[1].split('节')[0]) + 1; a++) &#123;</span>

                <span class="token comment">//         re.sections.push(&#123; section: a &#125;)</span>
                <span class="token comment">//     &#125;</span>
                <span class="token comment">//     //如果这个是空的，就不再到下边进行计算</span>
                <span class="token comment">//     //这里需要特判一下周六的形式政策</span>

                <span class="token comment">//     let wylt0 = lesson.split(')')[1].split(',')[0]</span>
                <span class="token comment">//     let wylt1 = lesson.split(')')[1].split(',')[1]</span>

                <span class="token comment">//     if (wylt1 == undefined) &#123;</span>
                <span class="token comment">//         let wylfir = Number(lesson.split(')')[1].split('-')[1].split('周')[0]);</span>
                <span class="token comment">//         console.log("look!")</span>

                <span class="token comment">//         console.log(lesson.split(')')[1])</span>
                <span class="token comment">//         for (let a = Number(lesson.split(')')[1].split('-')[0]); a &lt; wylfir + 1; a++) &#123;</span>
                <span class="token comment">//             re.weeks.push(a)</span>
                <span class="token comment">//         &#125;</span>
                <span class="token comment">//     &#125;</span>
                <span class="token comment">//     if (lesson[8] == '周' &amp;&amp; lesson[9] == ',') &#123;</span>
                <span class="token comment">//         re.weeks.push(Number(lesson.split(')')[1].split('周,')[0]))</span>
                <span class="token comment">//         re.weeks.push(Number(lesson.split(')')[1].split('周,')[1].split('周')[0]))</span>
                <span class="token comment">//     &#125;</span>
                <span class="token comment">//     if (lesson[9] == '周' &amp;&amp; lesson[10] == ',') &#123;</span>
                <span class="token comment">//         re.weeks.push(Number(lesson.split(')')[1].split('周,')[0]))</span>
                <span class="token comment">//         re.weeks.push(Number(lesson.split(')')[1].split('周,')[1].split('周')[0]))</span>
                <span class="token comment">//     &#125;</span>
                <span class="token comment">//     if (lesson.split(')')[1].split('-')[1] == null) continue;</span>
                <span class="token comment">// &#125;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    <span class="token keyword">let</span> lesson <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'('</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> a <span class="token operator">&lt;</span> <span class="token function">Number</span><span class="token punctuation">(</span>lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'('</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'节'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span> a<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                        re<span class="token punctuation">.</span>sections<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">&#123;</span> section<span class="token operator">:</span> a <span class="token punctuation">&#125;</span><span class="token punctuation">)</span>
                    <span class="token punctuation">&#125;</span>
                    <span class="token comment">//</span>
                    <span class="token keyword">let</span> wylt0 <span class="token operator">=</span> lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
                    <span class="token keyword">let</span> wylt1 <span class="token operator">=</span> lesson<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">')'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">','</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>

                    <span class="token comment">// console.log("look0!")</span>
                    <span class="token comment">// console.log(wylt0)</span>
                    <span class="token comment">// console.log(wylt0.length)</span>

                    <span class="token comment">//>=4代表把单周扔出去</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>wylt0<span class="token punctuation">.</span>length <span class="token operator">>=</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                        <span class="token keyword">let</span> wylfir <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>wylt0<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'周'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token comment">// console.log("look1!")</span>

                        <span class="token comment">// console.log(wylfir)</span>
                        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>wylt0<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> a <span class="token operator">&lt;</span> wylfir <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span> a<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                            re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
                        <span class="token punctuation">&#125;</span>
                    <span class="token punctuation">&#125;</span>

                    <span class="token comment">//处理第二个连贯周</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>wylt1 <span class="token operator">!==</span> <span class="token keyword">undefined</span> <span class="token operator">&amp;&amp;</span> wylt1<span class="token punctuation">.</span>length <span class="token operator">>=</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                        <span class="token keyword">let</span> wylfir <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>wylt1<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'周'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token comment">// console.log("look2!")</span>
                        <span class="token comment">// console.log(wylt1.split('-')[0]);</span>
                        <span class="token comment">// console.log(wylfir)</span>
                        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>wylt1<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> a <span class="token operator">&lt;</span> wylfir <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span> a<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                            re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
                        <span class="token punctuation">&#125;</span>
                    <span class="token punctuation">&#125;</span>

                    <span class="token comment">//处理形势与政策</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>wylt1 <span class="token operator">!==</span> <span class="token keyword">undefined</span> <span class="token operator">&amp;&amp;</span> wylt1<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span> <span class="token operator">===</span> <span class="token operator">-</span><span class="token number">1</span> <span class="token operator">&amp;&amp;</span> wylt0<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span> <span class="token operator">===</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                        re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>wylt0<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
                        re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>wylt1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
                    <span class="token punctuation">&#125;</span>

                    <span class="token comment">//处理单周</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>wylt1 <span class="token operator">===</span> <span class="token keyword">undefined</span> <span class="token operator">&amp;&amp;</span> wylt0<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span><span class="token string">'-'</span><span class="token punctuation">)</span> <span class="token operator">===</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                        re<span class="token punctuation">.</span>weeks<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>wylt0<span class="token punctuation">.</span><span class="token function">split</span><span class="token punctuation">(</span><span class="token string">'周'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
                    <span class="token punctuation">&#125;</span>


                    <span class="token comment">// for (let a = Number(lesson.split(')')[1].split('-')[0]); a &lt; Number(lesson.split(')')[1].split('-')[1].split('周')[0]) + 1; a++) &#123;</span>

                    <span class="token comment">//     re.weeks.push(a)</span>
                    <span class="token comment">// &#125;</span>
                <span class="token punctuation">&#125;</span>


            <span class="token punctuation">&#125;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>title <span class="token operator">==</span> <span class="token string">'教师'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>teacher <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data
                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>attribs<span class="token punctuation">.</span>class <span class="token operator">==</span> <span class="token string">'title'</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>

                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">children</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">.</span>length<span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">&#123;</span>
                    re<span class="token punctuation">.</span>name <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span>aaa<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">children</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>children<span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">.</span>data

                <span class="token punctuation">&#125;</span>
            <span class="token punctuation">&#125;</span>

        <span class="token punctuation">&#125;</span>
        result<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>re<span class="token punctuation">)</span>
    <span class="token punctuation">&#125;</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>result<span class="token punctuation">)</span>

    <span class="token keyword">let</span> wyl_sectionTime <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">5</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">6</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">6</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">9</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">8</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span><span class="token punctuation">,</span>
        <span class="token punctuation">&#123;</span>
            <span class="token string">"section"</span><span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>
            <span class="token string">"startTime"</span><span class="token operator">:</span> wyl_startTime<span class="token punctuation">[</span><span class="token number">9</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
            <span class="token string">"endTime"</span><span class="token operator">:</span> wyl_endTime<span class="token punctuation">[</span><span class="token number">9</span><span class="token punctuation">]</span>
        <span class="token punctuation">&#125;</span>
    <span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token comment">// if (wyl_id[0] == 1) &#123;</span>
    <span class="token comment">//     if (wyl_id[1] == 7) &#123;</span>
    <span class="token comment">//         wyl_sectionTime = [&#123;</span>
    <span class="token comment">//                 "section": 1,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[0],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[0]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 2,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[1],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[1]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 3,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[2],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[2]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 4,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[3],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[3]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 5,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[4],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[4]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 6,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[5],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[5]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 7,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[6],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[6]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 8,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[7],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[7]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 9,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[8],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[8]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 10,</span>
    <span class="token comment">//                 "startTime": wyl_startTime4[9],</span>
    <span class="token comment">//                 "endTime": wyl_endTime4[9]</span>
    <span class="token comment">//             &#125;</span>
    <span class="token comment">//         ];</span>
    <span class="token comment">//     &#125; else if (wyl_id[1] == 8) &#123;</span>
    <span class="token comment">//         wyl_sectionTime = [&#123;</span>
    <span class="token comment">//                 "section": 1,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[0],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[0]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 2,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[1],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[1]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 3,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[2],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[2]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 4,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[3],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[3]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 5,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[4],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[4]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 6,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[5],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[5]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 7,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[6],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[6]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 8,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[7],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[7]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 9,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[8],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[8]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 10,</span>
    <span class="token comment">//                 "startTime": wyl_startTime3[9],</span>
    <span class="token comment">//                 "endTime": wyl_endTime3[9]</span>
    <span class="token comment">//             &#125;</span>
    <span class="token comment">//         ];</span>
    <span class="token comment">//     &#125; else if (wyl_id[1] == 9) &#123;</span>
    <span class="token comment">//         wyl_sectionTime = [&#123;</span>
    <span class="token comment">//                 "section": 1,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[0],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[0]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 2,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[1],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[1]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 3,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[2],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[2]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 4,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[3],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[3]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 5,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[4],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[4]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 6,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[5],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[5]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 7,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[6],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[6]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 8,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[7],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[7]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 9,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[8],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[8]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 10,</span>
    <span class="token comment">//                 "startTime": wyl_startTime2[9],</span>
    <span class="token comment">//                 "endTime": wyl_endTime2[9]</span>
    <span class="token comment">//             &#125;</span>
    <span class="token comment">//         ];</span>
    <span class="token comment">//     &#125;</span>
    <span class="token comment">// &#125; else if (wyl_id[0] == 2) &#123;</span>
    <span class="token comment">//     if (wyl_id[1] == 0) &#123;</span>
    <span class="token comment">//         wyl_sectionTime = [&#123;</span>
    <span class="token comment">//                 "section": 1,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[0],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[0]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 2,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[1],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[1]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 3,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[2],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[2]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 4,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[3],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[3]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 5,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[4],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[4]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 6,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[5],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[5]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 7,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[6],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[6]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 8,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[7],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[7]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 9,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[8],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[8]</span>
    <span class="token comment">//             &#125;,</span>
    <span class="token comment">//             &#123;</span>
    <span class="token comment">//                 "section": 10,</span>
    <span class="token comment">//                 "startTime": wyl_startTime1[9],</span>
    <span class="token comment">//                 "endTime": wyl_endTime1[9]</span>
    <span class="token comment">//             &#125;</span>
    <span class="token comment">//         ];</span>
    <span class="token comment">//     &#125;</span>
    <span class="token comment">// &#125;</span>
    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>wyl_sectionTime<span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token punctuation">&#123;</span>
        courseInfos<span class="token operator">:</span> result<span class="token punctuation">,</span>
        sectionTimes<span class="token operator">:</span> wyl_sectionTime
    <span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p>以上，如果哪里有问题请联系我~</p>
<p>迭代记录：</p>
<ul>
<li>v1.0：上线</li>
<li>v1.1：修复了周六形式与政策的bug</li>
<li>v2.0：修复了单周的bug，填上注释，修改代码规范，方便重构。</li>
<li>v2.1：修复了并列单周如果出现两位数字的时候只会读取第一位，原因是直接把切完的数组的第一位放进去了，也不知道自己当时怎么想的- -，又切了一次，把周切掉放进去就fix啦<del>感谢浙农林的zeyu同学报的bug</del></li>
<li>v3.0：换了一版时间，原来的东西都注释掉了，还是担心学校又改时间，到时候不方便改，也为了给大家留个参考。</li>
</ul>

  </div>
  <div>
    
  </div>
</article>
<div class="nav">
  
    <div class="nav-item-prev">
      <a 
        href="/2021/06/13/militaryChessAgreementInCGV1/" 
        class="nav-link">
        <i class="iconfont icon-left nav-prev-icon"></i>
        <div>
          <div class="nav-label">上一篇</div>
          
            <div class="nav-title">计算机博弈大赛军棋项目博弈协议 1.0版 </div>
          
        </div>
      </a>
    </div>
  
  
    <div class="nav-item-next">
      <a 
        href="/2021/06/13/Mayday/" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
            <div class="nav-title">人生无限公司 </div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8"><span class="toc-text">使用</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E7%8E%B0"><span class="toc-text">实现</span></a></li></ol>
</div></main>
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://api2.mubu.com/v3/photo/654b368e-b847-4122-982c-86d90b3f5275.jpg" 
    class="author-img" 
    alt="author avatar">

<p class="author-name">霜序廿</p>
<p class="author-description">无限进步</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/archives">
    <span>253</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/categories">
    <span>6</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/tags">
    <span>51</span>
    <span>标签</span>
  </a>
</div>

  <div class="author-card-society">
    
      <div class="author-card-society-icon">
        <a target="_blank" rel="noopener" href="https://github.com/shuangxunian">
          <i class="iconfont icon-github society-icon"></i>
        </a>
      </div>
    
      <div class="author-card-society-icon">
        <a target="_blank" rel="noopener" href="https://space.bilibili.com/391117803">
          <i class="iconfont icon-bilibili society-icon"></i>
        </a>
      </div>
    
  </div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8"><span class="toc-text">使用</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E7%8E%B0"><span class="toc-text">实现</span></a></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/categories/%E6%8A%80%E6%9C%AF%E6%96%87%E7%AB%A0/">
        <div class="categories-list-item">
          技术文章
          <span class="categories-list-item-badge">218</span>
        </div>
      </a>
    
      <a href="/categories/%E5%85%B6%E4%BB%96/">
        <div class="categories-list-item">
          其他
          <span class="categories-list-item-badge">16</span>
        </div>
      </a>
    
      <a href="/categories/%E6%97%85%E6%B8%B8/">
        <div class="categories-list-item">
          旅游
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/%E7%AE%97%E6%B3%95/">
        <div class="categories-list-item">
          算法
          <span class="categories-list-item-badge">8</span>
        </div>
      </a>
    
      <a href="/categories/%E8%80%83%E8%AF%95/">
        <div class="categories-list-item">
          考试
          <span class="categories-list-item-badge">8</span>
        </div>
      </a>
    
      <a href="/categories/%E9%98%85%E8%AF%BB/">
        <div class="categories-list-item">
          阅读
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/tags/js/" 
        title="js">
        <div class="tags-list-item">js</div>
      </a>
    
      <a 
        href="/tags/vue/" 
        title="vue">
        <div class="tags-list-item">vue</div>
      </a>
    
      <a 
        href="/tags/%E9%9D%A2%E8%AF%95/" 
        title="面试">
        <div class="tags-list-item">面试</div>
      </a>
    
      <a 
        href="/tags/css/" 
        title="css">
        <div class="tags-list-item">css</div>
      </a>
    
      <a 
        href="/tags/%E7%BD%91%E7%BB%9C/" 
        title="网络">
        <div class="tags-list-item">网络</div>
      </a>
    
      <a 
        href="/tags/%E5%85%B6%E4%BB%96/" 
        title="其他">
        <div class="tags-list-item">其他</div>
      </a>
    
      <a 
        href="/tags/%E7%AE%97%E6%B3%95/" 
        title="算法">
        <div class="tags-list-item">算法</div>
      </a>
    
      <a 
        href="/tags/%E6%B5%8F%E8%A7%88%E5%99%A8/" 
        title="浏览器">
        <div class="tags-list-item">浏览器</div>
      </a>
    
      <a 
        href="/tags/html/" 
        title="html">
        <div class="tags-list-item">html</div>
      </a>
    
      <a 
        href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" 
        title="操作系统">
        <div class="tags-list-item">操作系统</div>
      </a>
    
      <a 
        href="/tags/%E8%80%83%E8%AF%95/" 
        title="考试">
        <div class="tags-list-item">考试</div>
      </a>
    
      <a 
        href="/tags/%E8%BD%AF%E5%AE%9E%E5%8A%9B/" 
        title="软实力">
        <div class="tags-list-item">软实力</div>
      </a>
    
      <a 
        href="/tags/DOM/" 
        title="DOM">
        <div class="tags-list-item">DOM</div>
      </a>
    
      <a 
        href="/tags/%E8%BD%AE%E5%AD%90/" 
        title="轮子">
        <div class="tags-list-item">轮子</div>
      </a>
    
      <a 
        href="/tags/%E7%BD%91%E7%BB%9C%E5%8E%9F%E7%90%86/" 
        title="网络原理">
        <div class="tags-list-item">网络原理</div>
      </a>
    
      <a 
        href="/tags/debug/" 
        title="debug">
        <div class="tags-list-item">debug</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8"><span class="toc-text">使用</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%9E%E7%8E%B0"><span class="toc-text">实现</span></a></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2022-05-01</div>
        <a href="/2022/05/01/typescriptHome/"><div class="recent-posts-item-content">typescript</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2022-01-15</div>
        <a href="/2022/01/15/javaScriptTheVariousWaysAndAdvantagesAndDisadvantagesOfDeepInheritance/"><div class="recent-posts-item-content">JavaScript深入之继承的多种方式和优缺点</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2022-01-15</div>
        <a href="/2022/01/15/javaScriptGoFromPrototypeToPrototypeChain/"><div class="recent-posts-item-content">JavaScript深入之从原型到原型链</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2022-01-15</div>
        <a href="/2022/01/15/javaScriptMemoryLeakTutorial/"><div class="recent-posts-item-content">JavaScript 内存泄漏教程</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    关注嘉然！顿顿解馋！
  </div>
  <div class="recent-posts-list">
    
      <img 
        src="https://api2.mubu.com/v3/document_image/2697c6ae-10ee-41a3-9099-304bdb252d31-3807603.jpg" 
        class="myadd-img" 
        alt="author avatar">
    
  </div>
</div>
  </article>
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2020 -
          
          2022
        </span>
        &nbsp;
        <a 
          href="/" 
          class="footer-link">
          霜序廿的个人网站
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
</footer> 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton" 
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/js/main.js"></script> 
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/js/lib/lozad.min.js', addLazyload)
      </script>
     
    
    
  </body>
</html>
